import java.util.HashMap;
import java.util.Map;

public class MapTraversal {

    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        map.put("语文", "90");
        map.put("数学", "80");
        map.put("英语", "70");
        map.put("物理", "89");

        map.forEach((k, v)-> System.out.println(k + ":" + v));
        for (Map.Entry<String, String> entry : map.entrySet()) {
            System.out.println(entry.getKey() + ":" + entry.getValue()); 
        }
    }
}